﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Administrator/Views/Shared/AdminMasterPage.master"
    Inherits="System.Web.Mvc.ViewPage<easyccms.WebUI.Areas.Administrator.Models.MenuListModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    
    <div class="page-title ui-widget-content ui-corner-all">
        <div class="float-right">
        <%= Html.ActionLink("Add new","Create") %>            
        </div>
        <h1>
        
            <b>Menu Management</b></h1>
        <div class="other">
            <div class="hastable">
                <table id="Table1">
                    <thead>
                        <tr>
                            <th>
                                #
                            </th>
                            <th>
                                Menu label
                            </th>
                            <th>
                                Order
                            </th>
                            <th>User</th>
                            
                            <th>
                                User group
                            </th>
                            <th>
                                ID
                            </th>
                            <th style="width: 100px">
                                Options
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        <%
                            int i = 0;
                        %>
                        <% foreach (easyccms.BusinessLayer.Entities.Menu item in Model.Menus.OrderBy(x=>x.MenuOrder))
                           {
                               //i++; 
                        %>
                        <tr <%= (i/2==0)?"class=\"even\"":"class=\"odd\"" %>>
                            <td>
                                <%= i++ %>
                            </td>
                            <td>
                                <%:item.Name %>
                            </td>
                            <td>
                            
                           <%= item.MenuOrder%>
                            </td>
                            <td>
                                <%= string.Format("{0} {1}", item.User.UserProfile.Name, item.User.UserProfile.Surname)%>
                            </td>                            
                            <td>
                                <%= item.UserGroup.GroupName %>
                            </td>
                            <td>
                                <%= item.MenuId %>
                            </td>
                            <td>
                                <%: Html.ActionLink("Edit", "Edit", new { id=item.MenuId }) %>
                                |
                                <%: Html.ActionLink("Bin it", "MoveToBin", new { id = item.MenuId })%>
                            </td>
                        </tr>
                        <% } %>
                    </tbody>
                </table>
            </div>
            <div class="clearfix">
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="HeadPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="JavaScriptHolder" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
</asp:Content>
